In computer graphics, a color image typically comprises a two dimensional array of binary color values, called a pixmap. The elements in the array are sometimes referred to as pixel values or "pixels," which represent the individual picture elements of an image. To display these pixels, a display controller typically reads the elements in an array, converts them into values compatible with the display monitor and controls the monitor's display of the image. For example, a display screen on a raster display device is comprised of an array of pixels. In the process of displaying an image on the monitor, the raster scans across the display screen energizing the individual picture elements with an electron beam based on the color values for each pixel.
A color table or "palette" is often used to compress a color image. Rather than store color values for each pixel, the pixmap can store indices into a color table instead. The entries in the color table store color values, which represent the available color choices for the pixmap or pixmaps that refer to the table. While the available color choices do not represent every conceivable color choice, they are generally deemed sufficient for the their particular application.
A color table is a form of image compression because the indices to a color table occupy fewer bits than the corresponding entries in the table. The trade off is that the color table represents a limited range of color choices. Consider the following example. One of the ways to represent the color of a pixel is to store a binary value for the Red, Green, and Blue (RGB) color components. For example, a color image can be represented with 8 bit R, G, B values. The total length of a pixel would then be 24 bits. Now, if the image is represented with only 256 colors for example, each of the 8 bit RGB values for these 256 colors can be stored in a color table having 256 entries. This color table is sometimes called an 8 bit color table because the entries to the table can be represented by an 8 bit number. Instead of storing 24 bits for each pixel in an image, each pixel can be represented by a single 8 bit index to the color table. By using the color table, the image is compressed by about a factor of 3.
While color tables provide an effective form of compression, they can also lead to difficult bookkeeping problems for application programmers. The images used in a typical game application, for example, may refer to different and inconsistent color tables. Ultimately, the display controller must have the accurate color information in order to generate the display image properly.